package org.meichao.demo.service.sequence;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchB implements Runnable {

    private CountDownLatch countDownLatchAB;
    private CountDownLatch countDownLatchBC;

    public CountDownLatchB(CountDownLatch countDownLatchAB, CountDownLatch countDownLatchBC) {
        this.countDownLatchAB = countDownLatchAB;
        this.countDownLatchBC = countDownLatchBC;
    }

    @Override
    public void run() {
        try {
            countDownLatchAB.await();
            System.out.println("b");
            countDownLatchBC.countDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }
}
